#ifndef CDISPLAYWIDGET_H
#define CDISPLAYWIDGET_H

#include <QObject>
#include <QWidget>
#include <QVector>

class CDisplayWidget : public QWidget
{
    Q_OBJECT
public:
    explicit CDisplayWidget(QWidget *parent = nullptr);

private:
    void initWidget();

    void paintGrid(QPainter &painter);

    void paintClickPointList(QPainter &painter);

    void paintBezierCurve(QPainter &painter);

    void paintTwoOrderRollLine(QPainter &painter);

    void paintThreeOrderRollLine(QPainter &painter);

    void paintEvent(QPaintEvent *);

    void mousePressEvent(QMouseEvent *event);

signals:

    void signalSendMouseLeftClickedPoint(QPoint);

    void signalClearAll();

public slots:

    void slotClearAll();

    void slotRecvTwoOrderBezierPoints(QPoint);

    void slotRecvThreeOrderBezierPoints(QPoint);

    void slotRecvTwoBezierRollLine(QPoint, QPoint);

    void slotRecvThreeBezierRollLine(QPoint, QPoint, QPoint, QPoint, QPoint, QPoint);

    void slotRecvPaintOriginLineFlag(bool);

    void slotRecvPaintCurveFlag(bool);

private:
    quint16 m_size_x;
    quint16 m_size_y;

    QVector<QPoint> m_clicked_points;
    QVector<QPoint> m_two_order_bezier_curve_points;
    QVector<QPoint> m_three_order_bezier_curve_points;

    QPoint m_two_bezier_roll_line_start;
    QPoint m_two_bezier_roll_line_end;

    QPoint m_three_bezier_roll_line_1_start;
    QPoint m_three_bezier_roll_line_1_end;

    QPoint m_three_bezier_roll_line_2_start;
    QPoint m_three_bezier_roll_line_2_end;

    QPoint m_three_bezier_roll_line_3_start;
    QPoint m_three_bezier_roll_line_3_end;

    bool  m_paint_origin_line;
    bool  m_paint_bezier_curve;

};

#endif // CDISPLAYWIDGET_H
